package model;

import interfaces.VareInterface;
import java.rmi.RemoteException;
import java.rmi.server.UnicastRemoteObject;

public class Vare extends UnicastRemoteObject implements VareInterface {
    private final String vareNavn;
    private final double varePris;
    private double vareGruppeRabat;
    private final int antal;
    private final String vareGruppe;

    public Vare(String vareNavn, double varePris, int antal, String vareGruppe) throws RemoteException {
        this.vareNavn = vareNavn;
        this.varePris = varePris;
        this.antal = antal;
        this.vareGruppe = vareGruppe;
        this.vareGruppeRabat = 0;
    }

    public double getVareGruppeRabat() throws RemoteException {
        return vareGruppeRabat;
    }

    public void setVareGruppeRabat(double vareGruppeRabat) throws RemoteException {
        this.vareGruppeRabat = vareGruppeRabat;
    }

    @Override
    public int getAntal() throws RemoteException {
        return antal;
    }

    @Override
    public String getVareNavn() throws RemoteException {
        return vareNavn;
    }

    @Override
    public double getVarePris() throws RemoteException {
        return varePris;
    }

    @Override
    public String getVareGruppe() throws RemoteException {
        return vareGruppe;
    }

    
    
    
    @Override
    public String toString() {
        return "\n===============\n Vare{" + ""
                + "\n\tvareNavn\t:" + vareNavn + 
                ",\n\tvarePris\t:" + varePris + 
                ",\n\tantal\t\t:" + antal + 
                "\n================"+"}\n";
    }

    
    
    
    
    
    
}
